package com.auto.nastoolbox

import android.content.Context
import android.content.Intent
import androidx.navigation.NavGraph.Companion.findStartDestination
import androidx.navigation.NavHostController
import com.auto.qinglong.ui.activity.QlActivity

/**
 * Created by YuanWei1 on 2025/6/3.
 *
 * Description:
 */
/**
 * Destinations used in the [JetnewsApp].
 */
object NasDestinations {
    /**
     * Home Route
     * 首页路由
     */
    val HOME_ROUTE: String = "home"

    /**
     * Setting
     * 设置页
     */
    val SETTING: String = "setting"

    /**
     * Qinglong
     *  青龙面板
     */
    val QINGLONG: String = "qinglong"
    val NAs: String = "nas"
}

class NasNavigationActions(val navController: NavHostController) {
    fun navigateToHome() {
        navController.navigate(NasDestinations.HOME_ROUTE) {
            popUpTo(navController.graph.findStartDestination().id) {
                saveState = true
            }
            launchSingleTop = true
        }
    }

    fun navigateToSetting() {
        navController.navigate(NasDestinations.SETTING)
    }

    fun navigateToQl(context: Context) {
        context.startActivity(Intent(context, QlActivity::class.java))
    }

    fun navigateToNas() {
        navController.navigate(NasDestinations.NAs)
    }
}